package _15define._another;

import static _15define._another.Computer.ComputeTool.calc;

public class Computer {
    public static void main(String[] args) {
        /* ComputeTool computeTool=new Computer().new ComputeTool(); */
        System.out.println("addition:"+calc(Double::sum,5,3));
        System.out.println("subtraction:"+calc((a, b) -> a-b,5,3));
        System.out.println("multiplication:"+calc((a, b) -> a*b,5,3));
        System.out.println("division:"+calc((a, b) -> a/b,5,3));
    }
    interface Compute{
        double compute(double a,double b);
    }
    class ComputeTool{
        private ComputeTool(){
        }
        public static double calc(Compute com,double a,double b){
            return  com.compute(a,b);
        }
    }
}


